﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XrmLibrary.Exceptions;

namespace XrmLibrary.Pooling.Collections
{
    public class OrganizationServicePoolList : List<OrganizationServicePool>
    {
        public OrganizationServicePool this[String configurationName]
        {
            get
            {
                foreach (OrganizationServicePool orgServicePool in this)
                {
                    if (orgServicePool.GetServiceName() == configurationName)
                    {
                        return orgServicePool;
                    }
                }
                throw new XrmLibraryException("No OrganizationServicePool exists for the supplied name.");
            }
        }
    }
}
